# Which compiler
# CC = gcc
# AR = ar
# AT = @


OUTPUT = zigbeegw


# source file
SRCS := ${wildcard *.c}

OBJS = $(patsubst %.c,%.o,$(SRCS))

LIBS += -lObjectModule
LIBS += -ldymem
LIBS += -lpthread

# Where are include files kept
INCLUDES := -I$(MIDDLEWARE_PATH)
INCLUDES += -I$(MIDDLEWARE_PATH)/dymem
INCLUDES += -I${MIDDLEWARE_PATH}/objectmodule

# Option for development
CFLAGS = -g -O2 -Wall
# Option for release
# CFLAGS = -O -Wall


$(OUTPUT): $(OBJS)
	$(AT)$(CC) $^ -o $(BIN_PATH)$@ $(INCLUDES) $(LIBS) -L$(LIBS_PATH)

$(OBJS): $(SRCS)
	$(AT)$(CC) -c $< $(CFLAGS) $(INCLUDES) -o $@


.PHONY: clean
clean:
	$(AT)-rm -rf $(OBJS)

